/* 8911106 302933981 Ofri Keidar */

/******************************************************************************
* Student Name: Ofri Keidar
* Exercise Name: Ex6
* File Description: Class Item's implementation
******************************************************************************/

#include "Item.h"

/***************************************************************************************
* function name: Item(const short number, const string name)
* The Input: New item's number and name
* The output: None
* The Function operation: Initializes item's attributes as given values
***************************************************************************************/
Item::Item(const short number, const string name) {
	m_number = number; // set item's number as given number
	m_name = name; // set item's name as given name
}

/***************************************************************************************
* function name: Inventory(const Inventory& inventoryToCopy)
* The Input: Item object to be copied
* The output: None
* The Function operation: Creates a new item with number and name identical to given item's
***************************************************************************************/
Item::Item(const Item& itemToCopy) {
	m_number = itemToCopy.m_number;
	m_name = itemToCopy.m_name;
}

/***************************************************************************************
 * function name: friend ostream& operator << (ostream &os, const Item& itemToPrint)
 * The Input: Reference to item to be printed
 * The output: ostream reference
 * The Function operation: Prints item's details
 ***************************************************************************************/
ostream& operator << (ostream &os, const Item& itemToPrint) {
	cout << "[" << itemToPrint.m_number << "," << itemToPrint.m_name << "]";
	return os;
}

